package com.dyna.cp.mybatis.service;

import com.dyna.cp.mybatis.domain.entity.DemoEduExperience;
import com.dyna.cp.mybatis.domain.entity.DemoUser;
import com.dyna.cp.mybatis.domain.resp.DemoFriendListResp;
import com.dyna.domain.resp.PageResult;

import java.util.List;

public interface MybatisService {

    /**
     * 添加用户
     * @param demoUser demoUser
     * @return Boolean
     */
    Boolean addUser(DemoUser demoUser);

    /**
     * 批量添加用户
     * @param demoUser demoUser
     * @return Boolean
     */
    Boolean batchAddUser(DemoUser demoUser);

    /**
     * 获取详情
     * @param id id
     * @return DemoUser
     */
    DemoUser getDetail(Integer id);

    /**
     * 根据名称查询用户
     * @param name name
     * @return List<DemoUser>
     */
    List<DemoUser> getUserByName(String name);

    /**
     * 手动事务
     * @return Boolean
     */
    Boolean manualTransactional();

    /**
     * 根据id删除用户
     * @param id id
     * @return Boolean
     */
    Boolean del(Integer id);

    /**
     * 添加教育经验
     * @param body body
     * @return Boolean
     */
    Boolean addEduExperience(DemoEduExperience body);

    /**
     * 测试mybatis连表查询集合字段
     * @param id id
     * @return DemoFriendListResp
     */
    DemoFriendListResp testMybatisJoinFriend(Integer id);

    /**
     * 测试mybatis连表分页查询集合字段
     * @return PageResult<SysDictTypeResp>
     */
    PageResult<DemoFriendListResp> testMybatisJoinFriendPage();

}